﻿/**********************************************************************
 * @file   SEALineJunctionDialog.h
 * @brief  线连接对话框
 * @author BaGuijun (baguijun@163.com)
 * @date   2024-11-12
 *********************************************************************/
#ifndef _SEALineJunctionDialog_H
#define _SEALineJunctionDialog_H

#include "GUIJunctionDialogAPI.h"
#include "GUIJunctionDialogBase.h"
#include "FITK_Component/FITKAcousticsModel/FITKSEAJunctionLine.h"

namespace Ui {
    class SEALineJunctionDialog;
}

namespace Acoustics {
    class FITKSEAJunctionLine;
}

namespace EventOper {
    class ParaWidgetInterfaceOperator;
}

namespace GUI
{
    class SEAJunctionUserDefWidget;
    /**
     * @brief  线连接对话框
     * @author BaGuijun (baguijun@163.com)
     * @date   2024-11-12
     */
    class GUIJunctionDialogAPI SEALineJunctionDialog :public GUIJunctionDialogBase
    {
        Q_OBJECT;
    public:
        /**
         * @brief    构造函数
         * @param[i] dataID        数据id
         * @param[i] oper          操作器
         * @param[i] isCreate      是否创建
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-12
         */
        SEALineJunctionDialog(int dataID, EventOper::ParaWidgetInterfaceOperator* oper, bool isCreate);
        /**
         * @brief    析构函数
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-12
         */
        ~SEALineJunctionDialog();
        /**
         * @brief    初始化
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-12
         */
        void init();
        /**
         * @brief    设置连接点
         * @param[i] pointIDs        有效连接点列表
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-12
         */
        void setSubsysPoints(QList<int>& pointIDs);
        /**
         * @brief    设置节点（连接后创建的点）
         * @param[i] nodeIDs    节点id
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-12
         */
        void setNodes(QList<int>& nodeIDs);
    private slots:
        ;
        /**
         * @brief    OK按钮点击事件
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-13
         */
        void on_pushButton_Ok_clicked();
        /**
         * @brief    取消按钮点击事件
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-13
         */
        void on_pushButton_Cancel_clicked();
        /**
         * @brief    角度是否可修改选择框点击事件
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-13
         */
        void slotAlphaOveCheck();
    private:
        /**
         * @brief    创建初始化
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-12
         */
        void InitCreate();
        /**
         * @brief    编辑初始化
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-12
         */
        void InitEdit();
        /**
         * @brief    创建确定
         * @return   bool         是否成功
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-12
         */
        bool OKCreate();
        /**
         * @brief    编辑确定
         * @return   bool         是否成功
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-12
         */
        bool OKEdit();
        /**
         * @brief    将界面数据填充至数据对象中
         * @param[i] data     数据对象
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-12
         */
        void getDataFromWidget(Acoustics::FITKSEAJunctionLine* data);
        /**
         * @brief    将数据对象中的数据填充至界面
         * @param[i] data     数据对象
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-12
         */
        void setDataToWidget(Acoustics::FITKSEAJunctionLine* data);
    private:
        /**
         * @brief    更新连接表格
         * @param[i] junction          连接列表
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-12
         */
        void updateConnectTable(QList<Acoustics::FITKSEAJunLineConStr>& junction);
        /**
         * @brief    更新点表格
         * @param[i] nodeIDs            点ids
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-12
         */
        void updateNodeTable(QList<int>& nodeIDs);
    private:
        /**
         * @brief  ui对象
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-11-12
         */
        Ui::SEALineJunctionDialog* _ui = nullptr;
        /**
         * @brief  对称矩阵界面
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-11-13
         */
        SEAJunctionUserDefWidget* _userDefWidget = nullptr;
    };
}
#endif
